{% extends "WallabagCoreBundle::base.html.twig" %}

{% block css %}
    {{ parent() }}
    {% if not app.debug %}
        <link rel="stylesheet" href="{{ asset('wallassets/baggy.css') }}">
    {% endif %}
{% endblock %}

{% block scripts %}
    {{ parent() }}
    <script src="{{ asset('wallassets/baggy' ~ (app.debug ? '.dev' : '') ~ '.js') }}"></script>
{% endblock %}

{% block header %}
    <header class="w600p center mbm">
        <h1 class="logo">
            {% block logo %}
                <a title="{{ 'menu.left.back_to_unread'|trans }}" href="{{ path('unread') }}">
                    <img width="100" height="100" src="{{ asset('wallassets/themes/_global/img/logo-w.png') }}" alt="wallabag logo" />
                </a>
            {% endblock %}
        </h1>
    </header>
{% endblock %}

{% block menu %}
    <button id="menu" class="icon icon-menu desktopHide"><span>Menu</span></button>
    <ul id="links" class="links">
        <li class="menu unread"><a href="{{ path('unread') }}">{{ 'menu.left.unread'|trans }}</a></li>
        <li class="menu starred"><a href="{{ path('starred') }}">{{ 'menu.left.starred'|trans }}</a></li>
        <li class="menu archive"><a href="{{ path('archive') }}">{{ 'menu.left.archive'|trans }}</a></li>
        <li class="menu all"><a href="{{ path('all') }}">{{ 'menu.left.all_articles'|trans }}</a></li>
        <li class="menu tag"><a href="{{ path('tag') }}">{{ 'menu.left.tags'|trans }}</a></li>
        <li class="menu new"><a href="{{ path('new') }}">{{ 'menu.left.save_link'|trans }}</a></li>
        <li style="position: relative;"><a href="javascript: void(null);" id="search">{{ 'menu.left.search'|trans }}</a>
            <div id="search-form" class="messages info popup-form">
                {{ render(controller("WallabagCoreBundle:Entry:searchForm", {'currentRoute': app.request.attributes.get('_route')})) }}
            </div>
        </li>
        {% if craue_setting('restricted_access') %}
        <li class="menu site_credentials"><a href="{{ path('site_credentials_index') }}">{{ 'menu.left.site_credentials'|trans }}</a></li>
        {% endif %}
        <li class="menu config"><a href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a></li>
        {% if is_granted('ROLE_SUPER_ADMIN') %}
            <li class="menu users"><a href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a></li>
            <li class="menu internal"><a href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a></li>
            <li class="menu ignore"><a href="{{ path('ignore_origin_instance_rules_index') }}">{{ 'menu.left.ignore_origin_instance_rules'|trans }}</a></li>
        {% endif %}
        <li class="menu import"><a href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a></li>
        <li class="menu howto"><a href="{{ path('howto') }}">{{ 'menu.left.howto'|trans }}</a></li>
        <li class="menu developer"><a href="{{ path('developer') }}">{{ 'menu.left.developer'|trans }}</a></li>
        <li class="menu about"><a href="{{ path('about') }}">{{ 'footer.wallabag.about'|trans }}</a></li>
        <li class="menu quickstart"><a href="{{ path('quickstart') }}">{{ 'menu.left.quickstart'|trans }}</a></li>
        <li class="menu logout"><a class="icon icon-power" href="{{ path('fos_user_security_logout') }}">{{ 'menu.left.logout'|trans }}</a></li>
    </ul>
{% endblock %}

{% block messages %}
    {% for flashMessage in app.session.flashbag.get('notice') %}
        <div class="messages success">
            <a href="#" class="closeMessage">×</a>
            <p>{{ flashMessage|trans }}</p>
        </div>
    {% endfor %}
{% endblock %}

{% block footer %}
    <footer class="w600p center mt3 mb3 smaller txtright">
        <p>{{ 'footer.wallabag.powered_by'|trans }} <a href="http://wallabag.org">wallabag</a></p>
    </footer>
{% endblock %}
